public class protice14 {
    public static void main(String[] args) {
        /**
         * 输出1~1000以内质数(只能被1或本身整除的数)
         */
        boolean flag;
        for (int i = 2; i <1001 ; i++) {
            flag = false;
            for (int j = 2; j < i ; j++) {
                if(i%j==0){
                    flag = true;
                }
            }
            if (flag == false){
                System.out.print(i+"\t");
            }
        }


    }
}
